﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QLTV_Public;

namespace QLTV_Data
{
   public class NgonNgu_Data
    {
       KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
       public DataTable layDuLieu()
       {
           return kn.LayDuLieu("Load_tbl_NgonNgu");
       }
       public int Insert_NgonNgu(NgonNgu_Public tenNgonNgu)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@TenNgonNgu";
           value[0] = tenNgonNgu.TenNgonNgu;
           return kn.update("Insert_NgonNgu",name,value,n);
       }
       public int Update_NgonNgu(NgonNgu_Public maNgonNgu,NgonNgu_Public tenNgonNgu)
       {
           int n = 2;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaNgonNgu";
           value[0] = maNgonNgu.MaNgonNgu;
           name[1] = "@TenNgonNgu";
           value[1] = tenNgonNgu.TenNgonNgu;
           return kn.update("Update_NgonNgu", name, value, n);
       }
       public int Delete_NgonNgu(NgonNgu_Public maNgonNgu)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaNgonNgu";
           value[0] = maNgonNgu.MaNgonNgu;
           return kn.update("Delete_NgonNgu", name, value, n);
       }
    }
}
